<!--
 * @Descripttion: 后台管理系统
 * @version: 1.0
 * @Author: 狸猫
 * @Date: 2023-10-30 09:45:21
 * @LastEditors: 狸猫
 * @LastEditTime: 2024-01-03 16:30:27
-->
<template>
  <div style="margin-left: 30px;">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="基本信息记录" name="info">
        <el-table :data="infoList">
          <el-table-column
            label="时间"
            prop="createTime"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="操作人"
            prop="operatingRecordName"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="操作"
            prop="operatingRecordContent"
            :show-overflow-tooltip="true"
          />
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="租金修改记录" name="rent"></el-tab-pane>
      <el-tab-pane label="智能锁记录" name="lock"></el-tab-pane>
      <el-tab-pane label="状态变更记录" name="state"></el-tab-pane>
    </el-tabs>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>
<script>
import { operatingRecord } from "@/api/house/room";

export default {
  name: "operatingRecord",
  props: {
    roomId: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      activeName: "info",
      infoList: [],
      total: 0,
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询基本列表 */
    getList() {
      this.queryParams.houseId = this.roomId;
      operatingRecord(this.queryParams).then((response) => {
        this.infoList = response.rows;
        this.total = response.total;
      });
    },
    handleClick(tab, event) {
      console.log(tab, event);
    },
  },
};
</script>
